/*
 * Sesame Inc.
 * Copyright (c) 2009 All Rights Reserved.
 */
package com.sesame.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.sesame.service.AlbumService;
import com.sesame.service.ContactService;

/**
 * @author voidman
 * 
 */

public class DeleteGuestbookController extends AbstractController {

    private ContactService contactService;

    public void setContactService(ContactService contactService) {
        this.contactService = contactService;
    }

    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse reponse) throws Exception {

        Integer guestbookId = Integer.parseInt(request
                .getParameter("guestbookId"));
        contactService.deleteGuestbook(guestbookId);

        return new ModelAndView("redirect:" + request.getHeader("referer"));
    }

}